module.exports = {
  publicPath: process.env.NODE_ENV === "production" ? "/co/" : "/",
  // publicPath: "/co/",
  pwa: {
    iconPaths: {
      favicon32: "favicon.ico",
      favicon16: "favicon.ico",
      appleTouchIcon: "favicon.ico",
      maskIcon: "favicon.ico",
      msTileImage: "favicon.ico"
    }
  },
  devServer: {
    host: "localhost",
    port: 8080,
    https: false,
    open: true,

    proxy: {
      "/api": {
        // 目标 API 地址
        target: process.env.VUE_APP_HOSTURL,
        // 如果要代理 websockets
        ws: true,
        // 将主机标头的原点更改为目标URL
        changeOrigin: true,
        pathRewrite: {
          "^/api": "" // remove base path
        }
      }
    }
  }
};
